﻿@namespace BlazorFluentUI
@inherits FluentUIComponentBase
@using Microsoft.AspNetCore.Components.Web

@if (_needMeasurement)
{
    <div id="@Id" class=@($"{GlobalClassNames["root"]} {(ShowAsSecondaryTitle ? "ms-DocumentCardTitle-secondaryTitle" : "")} {ClassName}") title="@Title" style=@($"white-space: nowrap; {Style}") @ref=RootElementReference>
        @Title
    </div>
}
else if (ShouldTruncate && !string.IsNullOrWhiteSpace(TruncatedTitleFirstPiece) && !string.IsNullOrWhiteSpace(TruncatedTitleSecondPiece))
{
<div id="@Id" class=@($"{GlobalClassNames["root"]} {(ShowAsSecondaryTitle ? "ms-DocumentCardTitle-secondaryTitle" : "")} {ClassName}") title="@Title" @ref=RootElementReference style=@Style>
    @TruncatedTitleFirstPiece
    &hellip;
    @TruncatedTitleSecondPiece
</div>
}
else
{
    <div id="@Id" class=@($"{GlobalClassNames["root"]} {(ShowAsSecondaryTitle ? "ms-DocumentCardTitle-secondaryTitle" : "")} {ClassName}") title="@Title" @ref=RootElementReference style=@Style>
        @Title
    </div> 
}